<?php

declare(strict_types=1);

/**
 * Author: Jesse
 * Email : jessedev@163.com
 * Date: 2024/6/19 14:15
 * FileName: Validation.php
 * DESC: The Relentless Pursuit of Perfection.
 */

namespace Common\Kernel\Annotation;

use Attribute;
use Hyperf\Di\Annotation\AbstractAnnotation;
use Hyperf\Di\Annotation\AnnotationCollector;

/**
 * 校验器
 */
#[Attribute(Attribute::TARGET_METHOD)]
class Validation extends AbstractAnnotation
{
    public function __construct(public string $class, public string $method)
    {

    }

    public static function getMateData($class, $method)
    {
        return AnnotationCollector::getClassMethodAnnotation($class, $method)[__CLASS__] ?? null;
    }
}